#include<bits/stdc++.h>
using namespace std;
const int N = 1e5+5;
int n,m,k,f[N];
vector<int> g[N];
int tot;
vector<int> vec[N];
inline void get(int x,int y,int lca)
{
	tot++;
	while(x!=lca) vec[tot].push_back(x),x = f[x];
	vec[tot].push_back(lca);
	vector<int> tmp;
	while(y!=lca) tmp.push_back(y),y = f[y];
	reverse(tmp.begin(),tmp.end());
	for(auto i:tmp) vec[tot].push_back(i);
}
bool vis[N],ok[N];
int dfs(int u,int fa)
{
	f[u] = fa;
	int las = 0;
	for(auto v:g[u])
	{
		if(vis[v]) continue;
		vis[v] = 1;
		int res = dfs(v,u);
		if(res)
		{
			if(!las) las = res;
			else get(res,las,u),las = 0;
		}
	}
	if(ok[u])
	{
		if(!las) las = u;
		else get(u,las,u),las = 0;
	}
	return las;
}
signed main()
{
	freopen("travel.in","r",stdin);
	freopen("travel.out","w",stdout);
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	cin>>n>>m>>k;
	for(int i = 1,u,v;i<=m;i++)
		cin>>u>>v,g[u].push_back(v),g[v].push_back(u);
	for(int i = 1,x;i<=k;i++)
		cin>>x,ok[x] = 1;
	for(int i = 1;i<=n;i++)
		if(!vis[i]) vis[i] = 1,dfs(i,0);
	cout<<tot<<'\n';
	for(int i = 1;i<=tot;i++)
	{
		cout<<vec[i].size()<<' ';
		for(auto x:vec[i]) cout<<x<<' ';
		cout<<'\n';
	}
	return 0;
}

